﻿<%@ Page Title="" Language="C#" MasterPageFile="MasterPage.master" AutoEventWireup="true" CodeFile="DoctorDetail.aspx.cs" Inherits="DoctorDetail" %>

<%@ Register Src="menu.ascx" TagPrefix="uc1" TagName="menu" %>


<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
    <link href="css/DrCss.css" rel="stylesheet" />
 <style>  
     .drdeatailcolwidth td:first-child {width:80px; }
     .drdeatailcolwidth  {width:280px; }
 </style>
    <script src="js/jquery-2.1.1.min.js"></script>
    <script src="js/jquery-ui.min.js"></script>

     <script>
  $(function() {
    $( "#accordion" ).accordion({
      collapsible: true
    });
  });
  </script>
    <div class="main">
    
     <div id="drmenu">
        <uc1:menu runat="server" ID="menu" />
    </div>
    <div id="dataside">
        <h3>醫師簡介</h3>
        <div style="float:left">
        <asp:DetailsView ID="DetailsView1" runat="server"  Height="80px" Width="500px" CellPadding="4" ForeColor="#333333" GridLines="None" AutoGenerateRows="False" DataKeyNames="Staff_ID" DataSourceID="DrDetail">
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            <CommandRowStyle BackColor="#E2DED6" Font-Bold="True" />
            <EditRowStyle BackColor="#999999" />
            <FieldHeaderStyle BackColor="#E9ECF1" Font-Bold="True" />
            <Fields>
                <asp:ImageField DataImageUrlField="Staff_ID" DataImageUrlFormatString="HandlerDrPix.ashx?Staff_ID={0}" Visible="False">
                     <ControlStyle Width="60px" Height="60" />
                     <HeaderStyle Width="60px" />
                     <ItemStyle Width="300px" />
                </asp:ImageField>
                <asp:BoundField DataField="Staff_Name" HeaderText="姓名" SortExpression="Staff_Name" >
                <HeaderStyle Width="60px" />
                <ItemStyle Width="240px" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="職稱" SortExpression="Job_ID">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Job_ID") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Job_ID") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# ClassUtility.getJobTitles((int)Eval("Job_ID")) %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="科別" SortExpression="Div_ID">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Div_ID") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Div_ID") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# ClassUtility.getDivTitles((int)Eval("Div_ID")) %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="學歷">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("Staff_Edu") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("Staff_Edu") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label5" runat="server" Text='<%# ClassUtility.getStringbr((string)Eval("Staff_Edu")) %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="經歷">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Staff_Exp") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Staff_Exp") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# ClassUtility.getStringbr((string)Eval("Staff_Exp")) %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="專長">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("Staff_Skill") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("Staff_Skill") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label4" runat="server" Text='<%# ClassUtility.getStringbr((string)Eval("Staff_Skill")) %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Staff_Email" HeaderText="E-mail" SortExpression="Staff_Email" />
            </Fields>
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" Height="40px" />

        </asp:DetailsView>
        
        
        
        <asp:SqlDataSource ID="DrDetail" runat="server" ConnectionString="<%$ ConnectionStrings:MedicareConnectionString %>" SelectCommand="SELECT [Staff_ID], [Staff_Pix], [Staff_Name], [Job_ID], [Div_ID], [Staff_Email], [Staff_Edu], [Staff_Exp], [Staff_Skill] FROM [Staffs] WHERE ([Staff_ID] = @Staff_ID)" ProviderName="System.Data.SqlClient">
            <SelectParameters>
                <asp:QueryStringParameter Name="Staff_ID" QueryStringField="Staff_ID" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
            </div>
        <div style="float:right; height: 122px; width: 101px;">
             <asp:FormView ID="FormView1" runat="server" Width="40px" DataKeyNames="Staff_ID" DataSourceID="SqlDataSource1">
            <EditItemTemplate>
                Staff_Pix:
                <asp:TextBox ID="Staff_PixTextBox" runat="server" Text='<%# Bind("Staff_Pix") %>' />
                <br />
                <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="更新" />
                &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="取消" />
            </EditItemTemplate>
            <InsertItemTemplate>
                Staff_Pix:
                <asp:TextBox ID="Staff_PixTextBox" runat="server" Text='<%# Bind("Staff_Pix") %>' />
                <br />
                <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="插入" />
                &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="取消" />
            </InsertItemTemplate>
            <ItemTemplate>
                <asp:Image ID="Image1" runat="server" Height="150px" Width="150px" ImageUrl='<%#"HandlerDrPix.ashx?Staff_ID="+ Eval("Staff_ID") %>'  />
            </ItemTemplate>
        </asp:FormView>
    
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Data Source=.;Initial Catalog=Medicare;Integrated Security=True" ProviderName="System.Data.SqlClient" SelectCommand="SELECT DISTINCT [Staff_ID], [Staff_Pix] FROM [Staffs] WHERE ([Staff_ID] = @Staff_ID)" >
            <SelectParameters>
                <asp:QueryStringParameter Name="Staff_ID" QueryStringField="Staff_ID" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>

            </div>


    </div>
    
       
    
    </div>
  
  
  
  


</asp:Content>

